Method for processing rate group, method for charging for data service, and related device and system

ABSTRACT

Embodiments of the present invention provide a method for processing a rate group, a method for charging for a data service, and a related device and system, so as to enable a charging system to accurately charge for the data service when the rate group changes. The method includes: determining, by a gateway device, whether a rate group of a service data stream changes; and if the rate group of the service data stream changes, reporting, by the gateway device, charging data to the charging system, so that the charging system performs charging according to the charging data, where the charging data includes service usage information and a reporting reason for reporting the charging data, and the reporting reason indicates a change of the rate group.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a continuation of U.S. patent application Ser. No.16/ 552,824 filed on Aug. 27, 2019, which is a continuation of U.S.patent application Ser. No. 15/453,064, filed on Mar. 8, 2017, which isa continuation of U.S. patent application Ser. No. 14/072,695, filed onNov. 5, 2013, now U.S. Pat. No.9,628,977. which is a continuation ofInternational Application No. PCT/CN2011/073756, filed on May 6, 2011.All of the afore-mentioned patent applications are hereby incorporatedby reference in their entireties.

TECHNICAL FIELD

The present invention relates to the field of communications, and inparticular, to a method for processing a rate group, a method forcharging for a data service, and a related device and system.

BACKGROUND

Large-scale deployment of 3rd generation mobile communications greatlydrives usage of a data service, and accurate charging of the dataservice is a basis for conduction of the data service. Policy andcharging control (PCC) is a set of policy and charging controlmechanisms defined by the 3rd Generation Partnership Project (3GPP). Thecore of a PCC mechanism is as follows: When establishing a bearer for adata stream, a gateway (GateWay) device requests a charging controlpolicy of the data stream from a policy and charging rules function(PCRF); if an application function (AF) provides service-layerinformation of a service for the PCRF, the PCRF generates a dynamiccontrol policy for charging and service data stream or determines astatic control policy to be activated for charging and service datastream, according to subscriber information stored in a subscriptionprofile repository (SPR), bearer-layer information provided by thegateway, certain local policies that are configured by an operator inthe PCRF and the service-layer information. The PCRF delivers a commandfor installing the generated dynamic policy or activating the determinedstatic policy stored in the gateway to a policy and charging enforcementfunction (PCEF) in the gateway; and the PCEF performs, according to theinstalled/activated policy, resource allocation, data stream control,and charging control. The PCC mechanism can implement, according to apolicy of the operator, precise control on a service data stream, so asto implement fine-grained operation of bandwidth.

In the preceding PCC mechanism, the AF is a service network element, andprovides information related to a service accessed by a subscriber. Forexample, the AF can provide information such as a service identifier, aservice priority indication, and a service urgency indication for thePCRF.

In the PCC, the PCRF is a policy decision entity responsible forcontrolling QoS, bandwidth, gating, charging control policies, and so onwhen a user equipment uses a service in a home network, and generating adynamic policy or specifying a static policy, where the policy isexecuted by the policy and charging enforcement function.

The PCEF is a policy execution entity, and is configured to execute adynamic control policy delivered by the PCRF or a specified staticcontrol policy, and may be located in a gateway device, such as a GGSN,a P-GW, or a WAP gateway.

The SPR is a subscription data storage entity and stores subscriptiondata of the subscriber.

When the PCEF performs charging control, a case where a rate groupchanges may appear in certain scenarios. With regard to a change of arate group on a side of a network element, the prior art has notprovided an appropriate processing method for a charging system toperform charging. As a result, after the rate group changes, an existingcharging system fails to receive accurate information and then fails toperform precise processing according to the change of the rate group,thereby affecting charging accuracy. Meanwhile, because accurateprocessing cannot be performed on the change of the rate group, aproblem where partial traffic before service identification cannot beaccurately charged may appear in PCRF-based data service chargingcontrol.

SUMMARY

Embodiments of the present invention provide a method for processing arate group, a method for charging for a data service, and a relateddevice and system, so as to enable a charging system to accuratelycharge for the data service when the rate group changes.

An embodiment of the present invention provides a method for processinga rate group, including: determining, by a gateway device, whether arate group of a service data stream changes; and if the rate group ofthe service data stream changes, reporting, by the gateway device,charging data to a charging system, so that the charging system performscharging according to the charging data, where the charging dataincludes service usage information and a reporting reason for reportingthe charging data, and the reporting reason indicates a change of therate group.

An embodiment of the present invention provides a method for chargingfor a data service, including: receiving, by a charging system, chargingdata reported by a gateway device when the gateway device determinesthat a rate group of a service data stream changes, where the chargingdata includes service usage information and a reporting reason forreporting the charging data, and the reporting reason indicates a changeof the rate group; determining, by the charging system, a rate of theservice data stream according to the reporting reason and an originalrate group; and performing, by the charging system, fee deduction on theservice usage information according to the determined rate.

An embodiment of the present invention provides a method for chargingfor a data service, including: determining, by a policy and chargingrules function PCRF entity, according to an identification result ofidentifying a service, whether to charge at a network layer and todeliver a charging control policy to a gateway device after generatingthe charging control policy, so that the gateway device executes thecharging control policy; and regenerating, if the PCRF confirms that itis necessary to change the charging control policy, a charging controlpolicy, and delivering the charging control policy to the gatewaydevice.

An embodiment of the present invention provides a gateway device,including: a rate group change determining module, configured todetermine whether a rate group of a service data stream changes; and acharging data reporting module, configured to report, if the rate groupchange determining module determines that the rate group of the servicedata stream changes, charging data to a charging system, so that thecharging system performs charging according to the charging data, wherethe charging data includes service usage information and a reportingreason for reporting the charging data, and the reporting reasonindicates a change of the rate group.

An embodiment of the present invention provides a charging system,including: a charging data receiving module, configured to receivecharging data reported by a gateway device when the gateway devicedetermines that a rate group of a service data stream changes, where thecharging data includes service usage information and a reporting reasonfor reporting the charging data, and the reporting reason indicates achange of the rate group; a rate determining module, configured todetermine a rate of the service data stream according to the reportingreason and an original rate group; and a fee deducting module,configured to perform fee deduction on the service usage informationaccording to the determined rate.

An embodiment of the present invention provides a policy and chargingrules function entity, including: a determining module, configured todetermine, according to an identification result of identifying aservice, whether it is necessary to charge at a network layer and todeliver a charging control policy to a gateway device after generatingthe charging control policy, so that the gateway device executes thecharging control policy; and a charging control policy generatingmodule, configured to regenerate, if it is confirmed that it isnecessary to change the charging control policy, a charging controlpolicy, and to deliver the charging control policy to the gatewaydevice.

It can be seen from the preceding embodiments of the present inventionthat, a gateway device can determine whether a rate group of a servicedata stream changes, and when the rate group of the service data streamchanges, report charging data including a re-determined rate group to acharging system, so that the charging system performs charging accordingto the charging data. Therefore, compared with the prior art, the methodfor processing a rate group that is provided by the embodiments of thepresent invention can enable the charging system to know a change of therate group, thereby reducing impacts of the change of the rate group oncharging accuracy and making the charging more accurate.

BRIEF DESCRIPTION OF DRAWINGS

To describe the technical solutions in the embodiments of the presentinvention more clearly, the following briefly introduces theaccompanying drawings required for describing the embodiments.Apparently, the accompanying drawings in the following description showmerely some embodiments of the present invention, and persons ofordinary skill in the art may still derive other drawings from theseaccompanying drawings without creative efforts.

FIG. 1 is a schematic flowchart of a method for processing a rate groupaccording to an embodiment of the present invention;

FIG. 2 is a schematic flowchart of a method for charging for a dataservice according to an embodiment of the present invention;

FIG. 3 is a schematic flowchart of interaction of devices in a methodfor charging for a data service according to an embodiment of thepresent invention;

FIG. 4 is a schematic flowchart of interaction of devices in a methodfor charging for a data service according to another embodiment of thepresent invention;

FIG. 5 is a schematic flowchart of a method for charging for a dataservice according to another embodiment of the present invention;

FIG. 6 is a schematic flowchart of a method for charging for a dataservice according to another embodiment of the present invention;

FIG. 7 is a schematic flowchart of interaction of devices in a methodfor charging for a data service according to another embodiment of thepresent invention;

FIG. 8 is a schematic flowchart of interaction of devices in a methodfor charging for a data service according to another embodiment of thepresent invention;

FIG. 9 is a schematic diagram of a logical structure of a gateway deviceaccording to an embodiment of the present invention;

FIG. 10 is a schematic diagram of a logical structure of a gatewaydevice according to another embodiment of the present invention;

FIG. 11 is a schematic diagram of a logical structure of a gatewaydevice according to another embodiment of the present invention;

FIG. 12 is a schematic diagram of a logical structure of a gatewaydevice according to another embodiment of the present invention;

FIG. 13 is a schematic diagram of a logical structure of a gatewaydevice according to another embodiment of the present invention;

FIG. 14 is a schematic diagram of a logical structure of a chargingsystem according to an embodiment of the present invention;

FIG. 15 is a schematic diagram of a logical structure of a policy andcharging rules function entity according to an embodiment of the presentinvention; and

FIG. 16 is a schematic diagram of a logical structure of a policy andcharging rules function entity according to another embodiment of thepresent invention.

DESCRIPTION OF EMBODIMENTS

Embodiments of the present invention provide a method for processing arate group, a method for charging for a data service, and a relateddevice and system, so as to enable a charging system to accuratelycharge for the data service when the rate group changes.

The following clearly and describes the technical solutions in theembodiments of the present invention with reference to the accompanyingdrawings in the embodiments of the present invention. Apparently, thedescribed embodiments are merely a part rather than all of theembodiments of the present invention. All other embodiments obtained bypersons of ordinary skill in the art based on the embodiments of thepresent invention without creative efforts shall fall within theprotection scope of the present invention.

A rate group (Rate Group) in the present invention is used to combineone or more services, which have same costs or rating types, for ease ofrating by a charging system. A concept of the rate group in the presentinvention is different from that of a conventional rate.

The rate refers to a unit price specified for each type of chargingunits. The rate group may be used as a basis for the charging system toselect a rate. Therefore, a change of the rate group may lead to achange of the rate, whereas the change of the rate has no impact on therate group.

Refer to FIG. 1, which is a schematic flowchart of a method forprocessing a rate group according to an embodiment of the presentinvention. An execution subject of the method may be a gateway device.The following steps are mainly included:

S101. A gateway device determines whether a rate group of a service datastream changes.

In the embodiment of the present invention, the gateway device refers toa gateway at a network layer, and includes a gateway general packetradio service support node (GGSN), a packet data network gateway (PacketData Network Gateway, P-GW), a Wireless Application Protocol (WAP)gateway, and so on. One aspect that these gateway devices have in commonis that a policy and charging enforcement function (PCEF) may beincluded therein. A PCRF entity is a policy decision entity, and mayexist separately or may be incorporated into another entity.

In the method for processing the rate group of the present invention,the gateway device may determine, as the following embodiments, whetherthe rate group of the service data stream changes:

Embodiment 1: The gateway device parses a service packet of the servicedata stream according to a service identification rule, andre-determines a rate group according to a parsed result and rate groupconfiguration of the gateway device, and if the re-determined rate groupis different from a current rate group, determines that the rate groupof the service data stream changes. That is to say, the gateway deviceis configured with a deep packet inspection (DPI) identification rule,parses information of a service stream according to the DPIidentification rule configured in the gateway device, and changes acharging control policy according to a parsed result, where the chargingcontrol policy includes a change of the rate group. Specificallyspeaking, the gateway device parses the service packet of the servicedata stream according to the DPI identification rule configured in thegateway device to acquire application-layer information of the servicedata stream, for example, what is obtained through parsing is a uniformresource locator (URL) of the service data stream, which protocol thedata stream is adopted, which application the service data streambelongs to, and what type the application is (for example, a streamingmedium), and so on. After the result is obtained through parsing, a rategroup is re-determined according to the rate group configuration (forexample, a matching relationship between a rate group and a service datastream) of the gateway device. If the re-determined rate group isdifferent from the current rate group, it is determined that the rategroup changes and the gateway device triggers a charging procedure forthe change of the rate group. It should be noted that, in thisembodiment, the current rate group is an effective rate group currentlyallocated in the gateway device to the service data stream, and may bedelivered previously by the PCRF to the gateway device or may be in astatic policy configured in the gateway device.

Embodiment 2: The gateway device receives an identification rule and acorresponding charging control policy that are delivered by the policyand charging rules function PCRF entity, where the charging controlpolicy includes a rate group; and then, the gateway device parses aservice packet of the service data stream according to theidentification rule delivered by the PCRF entity, matches, according toa parsed result, the rate group delivered by the PCRF entity tore-determine a rate group, and if the re-determined rate group isdifferent from a current rate group, determines that the rate group ofthe service data stream changes. That is to say, a PCRF in a home domaindelivers a DPI identification rule and a corresponding charging controlpolicy to the gateway device, and the gateway device parses informationof a service stream according to the delivered DPI identification ruleand executes the charging control policy according to the parsed result,where the charging control policy includes a change of the rate group.In this embodiment, the DPI identification rule that the PCRF in thehome domain delivers to the gateway device is based on the followingmechanism:

The PCRF determines, according configuration of an operator orsubscription data of a subscriber, that it is necessary to perform DPI;then, for each gateway device, a list of locations of corresponding DPImodules is configured in the PCRF to successfully download a DPIidentification rule,

TABLE 1 GGSN IP DPI Type DPI IP/Port List of rules or list ofidentifiers supported by a DPI module

as shown in Table 1 (a GGSN in the GPRS is taken as an example) above,where the DPI Type indicates whether a DPI module is built into or outof the gateway device (for example, a GGSN); the PCRF determines, byquerying the list, a DPI module corresponding to the gateway device, soas to know whether the gateway device has a DPI capability, and if yes,delivers the DPI identification rule to the gateway device; afterreceiving the DPI identification rule delivered by the PCRF, the gatewaydevice parses the service packet of the service data stream according tothe DPI identification rule to acquire application-layer information ofthe service data stream, for example, what is obtained through parsingis a URL of the service data stream, which protocol adopted, whichapplication the service data stream belongs to, what type theapplication is (for example, a streaming medium), and so on, and afterthe result is obtained through parsing, re-determines a rate groupaccording to the rate group included in the charging control policydelivered by the PCRF; and if the re-determined rate group is differentfrom an original rate group, it is determined that the rate groupchanges, and the gateway device triggers a charging procedure for thechange of the rate group. Similar to the preceding Embodiment 1, in thisembodiment, the current rate group is an effective rate group currentlyallocated in the gateway device to the service data stream, and may bedelivered previously by the PCRF to the gateway device or may be one ina static policy configured in the gateway device.

Embodiment 3: The gateway device receives an identification ruleidentifier and a corresponding charging control policy that aredelivered by the policy and charging rules function PCRF entity. In thisembodiment, the identification rule identifier is used to identify anidentification rule or a group of identification rules and maycorrespond to one or more applications, and the charging control policyincludes a rate group. The gateway device matches, by using theidentification rule identifier delivered by the PCRF entity anidentification rule configured in the gateway device, and parses aservice packet of the service data stream according to the matchedidentification rule, then matches the rate group delivered by the PCRFentity according to a parsed result to re-determine a rate group, and ifthe re-determined rate group is different from a current rate group,determines that the rate group of the service data stream changes. Thatis to say, a DPI identification rule is configured in the gatewaydevice, a DPI identification rule identifier is allocated to theconfigured DPI identification rule, a PCRF in a home domain delivers theDPI identification rule identifier and a corresponding charging controlpolicy, and the gateway device matches, according to the delivered DPIidentification rule identifier, the DPI identification rule configuredin the gateway device, thereby parsing information of the service datastream by using the DPI identification rule and executing the chargingcontrol policy according a parsed result, where the charging controlpolicies include the change of the rate group. In this embodiment, theDPI identification rule configured in the gateway device is based on thefollowing mechanism: For each gateway device, a list of locations ofcorresponding DPI modules (as specifically shown in Table 1 of thepreceding Embodiment 2) is configured in the PCRF to successfullydownload the DPI identification rule; the gateway device executes theDPI identification rule to parse the service packet of the service datastream, so as to acquire application-layer information of the servicedata stream, for example, what is obtained through parsing is a URL ofthe service data stream, which protocol adopted, which application theservice data stream belongs to, what type the application is (forexample, a streaming medium), and so on; after a result is obtainedthrough parsing, a rate group is re-determined according to the rategroup included in the charging control policy delivered by the PCRF; andif the re-determined rate group is different from an original rategroup, it is determined that the rate group changes, and the gatewaydevice triggers a charging procedure for the change of the rate group.Similar to the preceding Embodiment 1 or 2, in this embodiment, thecurrent rate group is an effective rate group currently allocated in thegateway device to the service data stream, and may be deliveredpreviously by the PCRF to the gateway device or may be one in a staticpolicy configured in the gateway device. It should be noted that, inthis embodiment, the DPI identification rule identified by the DPIidentification rule identifier may be a DPI identification rule of adifferent granularity for identifying, for example, a certain URL, acertain type of URLs, a certain type of application protocols, a certainspecific application or a certain type of applications (for example, atype of peer-to-peer P2P download).

Embodiment 4: The gateway device receives a charging control policyupdate command delivered by the policy and charging rules function PCRFentity, where the charging control policy update command includes a rategroup, and if the rate group included in the charging control policyupdate command is different from a current rate group, determines thatthe rate group of the service data stream changes. That is to say,according to the rule of the PCRF, information from an applicationlayer, or a result obtained from DPI performed by a

DPI network element, the PCRF remakes a policy decision for the servicedata stream, decides a new charging control policy, delivers andinstalls the charging control policy into the gateway device, where thecharging control policy includes a new rate group; the gateway devicereceives a policy and charging control rule (PCC Rule) delivered by aPCRF in a home domain and updates an existing PCC rule, where the rategroup is updated in the new PCC rule; and the gateway device triggers acharging procedure for the change of the rate group.

S102. If the rate group of the service data stream changes, the gatewaydevice reports charging data to the charging system, so that thecharging system performs charging according to the charging data.

It should be noted that, in the embodiment of the present invention, therate group has a priority attribute, that is, rate groups may have adifferent priority, so that the charging system is capable ofdetermining an appropriate rate group for service usage informationaccording to the priority of the rate group and performing chargingaccording to the determined rate group.

After detecting the change of the rate group, the gateway devicedisables a counter of the service data stream to stop counting theservice usage information (the service usage information corresponds tothe original rate group, and the original rate group in the presentinvention is the current rate group corresponding to the counted serviceusage information), and reports the charging data to the chargingsystem. The charging data includes the service usage information (suchas, data traffic or duration of an Internet subscriber) counted by thecounter of the service data stream, a reporting reason for reporting thecharging data, and so on. A value of the reporting reason (for onlinecharging, it is Reporting-Reason AVP; and for offline charging, it isChange-Condition AVP) carried in the reported charging data, isRATING_GROUP_CHANGE, indicating that reporting the charging data isbecause the rate group of the service data stream changes. In theembodiment of the present invention, the change of the rate group isused as a chargeable event (chargeable event).

In the embodiment of the present invention, if the charging system is anoffline charging system, the gateway device reports the charging data tothe charging system as follows: The gateway device reports the serviceusage information to a charging data function module, so that thecharging data function module encapsulates the service usage informationinto a charging data record (CDR), or the gateway device encapsulatesthe service usage information and reports the CDR obtained after theencapsulation to the charging system. After the gateway device reportsthe charging data to the offline charging system, the gateway deviceenables a new counter to re-record usage information of the service datastream and reports the usage information to the offline charging systemwhen a condition for reporting is met. The condition for reportingincludes reporting at a rate change time point, and so on, where therate change time point is configured in the gateway.

In the embodiment of the present invention, if the charging system is anonline charging system, that the gateway device reports the chargingdata to the charging system includes: the gateway device reportsauthorized usage information of the original rate group, to the onlinecharging system. Specifically, the authorized usage information of theoriginal rate group is reported by using a Used-Service-Unit parametercarried in a Diameter Credit Control Request command. If the servicedata stream still requires charging after the rate group of the servicedata stream changes, the gateway device applies, based on the rate groupincluded in the charging control policy update command or there-determined rate group, to the online charging system for creditauthorization after the gateway device reports the charging data to theonline charging system. Specifically, the credit authorized applicationis sent by using a Requested-Service-Unit parameter carried in theDiameter Credit Control Request command. The gateway device receives thecredit authorization granted, based on the rate group included in thecharging control policy update command or the re-determined rate group,by the online charging system, enables a new counter to re-record usageinformation of the service data stream, and reports the usageinformation to the online charging system when a condition for reportingis met. The condition for reporting may include: service start, serviceend, exhaustion of authorized credit quota, expiration of authorizedcredit quota, credit update required by the online charging system,re-authorization delivered by the online charging system, and so on.

After receiving the charging data reported by the gateway device, thecharging system re-determines a rate of the service data streamaccording to the reporting reason and the original rate group, andperforms fee deduction according to the re-determined rate. Thefollowing embodiment will give a detailed description.

It can be seen from the preceding embodiment of the present inventionthat, a gateway device can determine whether a rate group of a servicedata stream changes, and when the rate group of the service data streamchanges, report charging data including a re-determined rate group to acharging system, so that the charging system performs charging accordingto the charging data. Therefore, compared with the prior art, the methodfor processing a rate group that is provided by the embodiment of thepresent invention can enable the charging system to know a change of therate group, thereby reducing impacts of the change of the rate group oncharging accuracy and making the charging more accurate.

Refer to FIG. 2, which is a schematic flowchart of a method for chargingfor a data service according to an embodiment of the present invention.An execution subject of the method may be a charging system (includingan online charging system and an offline charging system). The followingsteps are mainly included:

S201. A charging system receives charging data reported by a gatewaydevice when the gateway device determines that a rate group of a servicedata stream changes.

In this embodiment, the charging data includes service usage informationand a reporting reason for reporting the charging data, where thereporting reason indicates that the gateway device reports the chargingdata because the rate group of the service data stream changes.

S202. The charging system re-determines a rate of the service datastream according to the reporting reason and an original rate group.

In the method for charging for a data service that is provided by thepresent invention, the charging system may re-determine, as thefollowing embodiments, the rate of the service data stream according tothe reporting reason and the original rate group:

Embodiment 1: If the original rate group is a high-priority rate group,the rate of the service data stream is re-determined by using theoriginal rate group. It should be noted that, in the embodiment of thepresent invention, the so-called high-priority rate group refers to arate group preferentially used by the charging system to determine arate, and then perform pricing and fee deduction on the reported serviceusage information, and so on.

Embodiment 2: If the original rate group is a low-priority rate group,the charging system stores usage information of the service data stream,and when receiving a high-priority rate group, re-determines the rate ofthe service data stream, or if the charging system does not receive ahigh-priority rate group before the service ends (for example, acharging session may end) or before a preset timeout setting isexceeded, re-determines the rate of the service data stream by using theoriginal rate group. It should be noted that, in the embodiment of thepresent invention, the low-priority rate group not only represents arate but also is used to express an indication, that is, indicating thatthe charging system preferentially uses another high-priority rate groupand uses the low-priority rate group only when no high-priority rategroup exists.

S203. The charging system performs fee deduction according to there-determined rate.

For example, if the charging system has not received a high-priorityrate group before the service ends or a preset timeout setting isexceeded, the rate of the service data stream is re-determined by usingthe original rate group and fee deduction is performed according to there-determined rate; that is, if the original rate group is alow-priority rate group corresponding to a rate of 0, fee deduction isnot performed on the service usage information corresponding to theservice data stream and the original rate group during this servicecharging, and if fee deduction has already been performed, a fee returnprocedure is enabled to return the deducted fee. Specifically, thecharging system stores the service usage information; after receiving anew high-priority rate group that may be used for the service datastream, uses the new rate group to perform rating and fee deduction, andif no new rate group is received before the service ends or before thepreset timeout setting is exceeded, uses the low-priority rate group toperform rating and fee deduction; and if a rate corresponding to thelow-priority rate group is 0, does not perform fee deduction on theservice usage information corresponding to the service data stream andthe rate group during this service charging, and if fee deduction hasalready been performed, enables a fee return procedure to return thededucted fee.

It can be seen from the method for charging for a data service shown inFIG. 2 that, a charging system may re-determine a rate of a service datastream according to a reporting reason for reporting charging data andan original rate group, where the charging data is reported by a gatewaydevice, and perform fee deduction according to the re-determined rate,and furthermore, flexibly indicate that the charging system selects, bydistinguishing between priorities of rate groups, a rate group with thehighest priority to perform charging. Therefore, the method for chargingfor a data service that is provided by the embodiment of the presentinvention reduces impacts of a change of a rate group on chargingaccuracy and making the charging more accurate.

The following further describes the method for charging for a dataservice that is provided by the present invention with reference to theembodiments in FIG. 1 and FIG. 2. Refer to FIG. 3, which is a schematicflowchart of interaction of devices in a method for charging for a dataservice according to an embodiment of the present invention. Thefollowing steps are mainly included:

S301. A gateway device determines whether a rate group of a service datastream changes.

As previously mentioned, the gateway device may determine, based on aresult obtained by parsing a service packet of the service data streamaccording to a service identification rule, whether the rate group ofthe service data stream changes; determine, based on a result obtainedby parsing a service packet of the service data stream according to anidentification rule delivered by a PCRF entity, whether the rate groupof the service data stream changes; determine, based on a resultobtained by parsing a service packet of the service data streamaccording to an identification rule matching the identification ruleidentifier delivered by the PCRF entity, whether the rate group of theservice data stream changes; or determine, according to whether the rategroup is updated in a charging control policy update command deliveredby the PCRF entity, whether the rate group of the service data streamchanges.

S302. If the rate group of the service data stream changes, the gatewaydevice reports charging data to a charging system.

After detecting that the rate group changes, the gateway device disablesa counter of the service data stream (the counter corresponds to anoriginal rate group) and reports the charging data to the chargingsystem. The charging data includes service usage information (such as,data traffic or duration of an Internet subscriber) counted by thecounter of the service data stream, a reporting reason for reporting thecharging data, and so on.

If the charging system is an online charging system, the gateway devicereports authorized usage information of the original rate group to theonline charging system (step S303). Furthermore, if the service datastream still requires charging after the rate group of the service datastream changes, the gateway device further applies, based on a rategroup included in a charging control policy update command or are-determined rate group, to the online charging system for creditauthorization after the gateway device reports the authorized usageinformation of the original rate group to the online charging system(step S304).

S305. The charging system receives the charging data reported by thegateway device when the gateway device determines that the rate group ofthe service data stream changes.

S306. The charging system re-determines a rate of the service datastream according to a reporting reason and the original rate group.

For example, according to a priority of the rate group, if the originalrate group is a high-priority rate group, the charging system may usethe original rate group to re-determine the rate of the service datastream; or if the original rate group is a low-priority rate group, thecharging system stores usage information of the service data stream, andwhen receiving a high-priority rate group, re-determines the rate of theservice data stream, or when the charging system does not receive ahigh-priority rate group, re-determines the rate of the service datastream by using the original rate group.

To clearly describe a procedure for interaction of devices in the methodfor charging for a data service shown in FIG. 3, the following takesInternet access (online charging is taken as an example) as an examplefor description. Refer to FIG. 4, and it is assumed that an operator maycarry out an ordinary rate for ordinary network use (such as, newsbrowse, information query, and forum discussion) and carry out acomparatively high rate for peer-to-peer (P2P) network use increasingnetwork pressure. This embodiment takes ordinary network use and P2Papplications as an example for description, where a rate group 1001 hasa same priority as a rate group 1003. The example shown in FIG. 4 mainlyincludes the following steps:

S401. When a subscriber accesses the Internet, a user equipment requestsa gateway device (including a PCEF entity) to establish a data bearerchannel for data transmission.

S402. The gateway device reports information related to a service streamto a PCRF and requests a policy, where the policy includes QoS, gating,and charging control policies, and so on.

S403. According to information related to a service stream that isprovided by gateway device and in combination with configuredinformation of the PCRF, subscription information from the outside,subscriber information or account information of the subscriber, and soon, the PCRF makes a policy decision, allocates QoS to the subscriberfor Internet access, and determines the rate group 1001.

S404. The PCRF delivers the policy to the gateway device, where thepolicy carries the QoS allocated to the subscriber for Internet accessand the rate group 1001.

S405. The gateway device requests, based on the rate group 1001delivered by the PCRF, credit authorization from an online chargingsystem.

S406. The online charging system determines a rate according to asubscriber type, a package type, a reward policy, rate groupinformation, and so on, performs the credit authorization according tothe rate and the account information of the subscriber, and returnscorresponding credit authorization to the gateway device.

S407. The subscriber uses a service, and the gateway device detects ausage condition of the credit authorization.

S408. A DPI module (which may be built into the gateway device, or builtout as an independent DPI network element) detects that the subscriberuses a P2P request and reports a result of the detection to the PCRF.

S409. The PCRF remakes a policy decision based on a result of thedetection and allocates the rate group 1003 for the P2P.

S410. The PCRF delivers the new rate group 1003 to the gateway device.

S411. The gateway device detects that the rate group changes, triggers acharging reporting action, and stops using the credit authorizationapplied by the rate group 1001 for the service.

S412. Apply for credit authorization again based on the rate group 1003.

S413. After receiving service usage information reported by the gatewaydevice, the online charging system decides, according to priorities ofthe rate group 1001 and the rate group 1003, to perform fee deduction onthe reported service usage information by taking the rate group 1001 asa basis, and performs the credit authorization according to a new creditapplication.

Although according to an existing PCC mechanism, the PCRF can deliverthe charging control policy, a change of a charging entity during acharging process (this mainly refers to a change from network-layercharging to application-layer charging) and charging data generatedbefore the change cannot be processed accurately, so that the chargingcontrol policy delivered by the PCRF may fail to cover all conditions,which may lead to overcharging or undercharging that is difficult tofind out, and in turn leads to a more serious problem. Therefore, it isimpossible to implement that the PCRF takes control of application-layercharging and network-layer charging for a data service, so that it isimpossible to implement, before the charging begins, determining thatcertain services are only charged at the application layer. In addition,an existing mode for charging for a data service is complex and has manycharging triggering points at an application layer, a network layer, andso on. For certain services (for example, an IMS call), charging needsto be triggered only at the application layer, certain services (forexample, ordinary new browse) only require triggering charging at thenetwork layer, certain services (for example, download of certaincontent) are charged at both the application layer and the network layerbut at different rates and so on. To avoid repetitive charging, currentcharging processing is processing during charging or processing aftercharging. The processing during charging mainly includes online chargingcorrelation. After receiving charging requests reported by differentnetwork elements, the online charging system performs chargingcorrelation to avoid repetitive charging. In this process, in oneaspect, the processing in the online charging system is complex, forexample, transmission of a charging correlation identifier between thenetwork layer and the application layer is hysteretic, and this makesthe online charging system fail to perform correlation in an initialcharging request but to attempt performing correlation after everycharging request comes subsequently, thereby making the processing ofthe online charging system complex and affecting processing performance;in another aspect, it is difficult to determine through correlationwhich network element is more reasonable for serving as a chargingnetwork element because no service information is available in theonline charging system. The processing after charging requirescorrelation of a large amount of charging information. A large number ofcharging data records pose a very great burden on the processing, posesa very high requirement on a processing system, and has a great impacton timeliness in billing.

To solve the preceding problems in the existing PCC mechanism, anembodiment of the present invention provides another method for chargingfor a data service. Refer to FIG. 5, which is a schematic flowchart of amethod for processing a data service according to another embodiment ofthe present invention. An execution subject of the method may be apolicy and charging rules function PCRF entity. The following steps aremainly included:

S501. The policy and charging rules function PCRF entity determines,according to an identification result of identifying a service, whetherit is necessary to charge at a network layer and to deliver a chargingcontrol policy to a gateway device after generating the charging controlpolicy, so that the gateway device executes the charging control policy.

In this embodiment, a charging rule may be configured in advance both ina PCRF in a home domain and in a charging system, where the chargingrule configured in the PCRF includes: a service, whether to charge on aPCEF, and a rate group. The service may be indicated by using anidentifier and may also be indicated by using an IP filtering ruleidentifier.

When the policy and charging rules function PCRF entity receives apolicy request message reported by the gateway device, the policyrequest message may include a service stream filtering rule, the PCRFentity identifies a service according to information reported by thegateway device. Specifically, if the policy request message carries theservice data stream filtering rule, the PCRF entity may match theidentification rule configured in the PCRF with the service streamfiltering rule reported by the gateway device. If the matching succeeds,the service is successfully identified, a charging rule corresponding tothe successfully identified service is queried from preconfiguredcharging rules according to an identification result, and it isdetermined, according to a query result, whether it is necessary tocharge at the network layer, and if yes, a rate group is furtherdetermined.

If it is determined, according to the query result, that it is necessaryto charge at the network layer, the PCRF generates the charging controlpolicy, where the charging control policy includes a rate groupcorresponding to the service. Optionally, the charging control policygenerated after it is determined, according to the query result, tocharge at the network layer further includes a charging mode forcharging for the service, such as, online charging or offline charging.If no charging mode is included, a default charging mode of the gatewaydevice is used.

If it is determined, according to the query result, that it isunnecessary to charge at the network layer, the PCRF generates thecharging control policy including an indication for not charging for theservice, for example, indicating not to perform online charging and notto perform offline charging.

The preceding embodiment is a case where the PCRF entity cansuccessfully match identification rule configured in the PCRF with theservice stream filtering rule reported by the gateway device. If thematching fails, the PCRF entity confirms that the service is anunidentifiable service, and the PCRF entity is not sure whether it isnecessary to charge the unidentifiable service at the network layer. Inthis case, the PCRF entity may still generate a charging control policyfor the unidentifiable service, which includes that: The PCRF entitygenerates a charging control policy including a low-priority rate groupand/or a general filtering rule for the unidentifiable service, so as tosubsequently identify the service, change the rate group, and rechargefor a used data stream. Furthermore, when the PCRF entity determinesthat it is unnecessary to charge for the unidentifiable service at thenetwork layer, the charging control policy generated by the PCRF entityfor the unidentifiable service includes a low-priority rate group with arate of 0. Specifically, according to a service that a subscribersubscribes to, the PCRF entity may determine certain preset generalfiltering rules and determine a low-priority rate group. Thelow-priority rate group represents that the charging system needs toperform pricing and fee deduction on a service data stream by selectinganother related rate group with a higher priority and considers thelow-priority rate group (the low-priority rate group corresponds to apreset rate, and the preset rate may indicate a non-charging rate 0 oranother rate) only when no other rate group exists. The charging systemmay identify the low-priority rate group, and the PCRF generates thecharging control policy. The charging control policy includes thepreceding determined filtering rules and low-priority rate group, andoptionally, may further include the charging mode. If no charging modeis included, the default charging mode of the gateway is used.

After the policy and charging rules function PCRF entity generates thecharging control policy and delivers the charging control policy to thegateway device, the gateway device executes the charging control policy.When the gateway executes the charging control policy, two cases areincluded, that is:

Case 1: The gateway device acquires the charging control policy andknows, according to the charging control policy, a charging indicationand a rate group. If the charging indication clearly requires onlinecharging or offline charging to be performed on a specific service datastream, the gateway device performs charging processing according to therate group. For online charging, firstly credit authorization isreserved in an online charging system, and service usage information iscollected based on the authorization. For offline charging, a chargingdata record is enabled to record the service usage information. The rategroup here may be an accurate rate group determined after a service issuccessfully identified and may also be a low-priority rate group whenthe service cannot be identified.

Case 2: The gateway device acquires the charging control policy andknows, according to the charging control policy, a charging indication.If the charging indication is that charging is not performed at thenetwork layer, the gateway device does not trigger online or offlinecharging but allocates bandwidth and QoS to the service data stream andthe service is released. Definitely, the gateway device may stillgenerate a charging data record not used for charging, where thecharging data record is used for reconciliation and other analysispurposes.

Furthermore, the gateway device reports collected service usageinformation to the charging system. That is to say, if it is necessaryto charge at the network layer, the gateway device collects the serviceusage information for the service, and when a condition for a chargingreport is met, reports the collected service usage information. In thisembodiment, the condition for reporting includes a change of the rategroup, where the change results from a policy of the gateway deviceitself. In this case, a reporting reason is carried in a reportedmessage indicates that an occurrence of a reporting action results fromthe change of the rate group.

The charging system receives charging data reported by the gatewaydevice, where the charging data includes the service usage informationand the reporting reason for reporting the charging data. If thereporting reason is the change of the rate group, the charging systemre-determines, a rate of the service data stream according to thereporting reason and an original rate group and performs fee deduction,which includes:

Embodiment 1: If the original rate group is a high-priority rate group,the rate of the service data stream is re-determined by using theoriginal group. It should be noted that, in the embodiment of thepresent invention, the so-called high-priority rate group refers to arate group preferentially used by the charging system to determine arate, and then perform pricing and fee deduction on the reported serviceusage information, and so on.

Embodiment 2: If the original rate group is a low-priority rate group,the charging system stores usage information of the service data stream,and when receiving a high-priority rate group, re-determines the rate ofthe service data stream, or when the charging system does not receive ahigh-priority rate group, re-determines the rate of the service datastream by using the original rate group. It should be noted that, in theembodiment of the present invention, the low-priority rate group notonly represents a rate but also is used to express an indication, thatis, indicating that the charging system preferentially uses anotherhigh-priority rate group and uses the low-priority rate group only whenno high-priority rate group exists.

S502. If the PCRF confirms that it is necessary to change the chargingcontrol policy, the PCRF regenerates a charging control policy anddelivers the charging control policy to the gateway device.

Confirming, by the PCRF, that it is necessary to change the chargingcontrol policy, thereby regenerating a charging control policy anddelivering the charging control policy to the gateway device includesthe following embodiments:

Embodiment 1: The PCRF correlates an application layer and the networklayer of the unidentifiable service according to application-layerinformation of the unidentifiable service and performs identification onthe unidentifiable service. Specifically, when the service data streamarrives at the application layer, an application-layer network elementmay report the application-layer information of the service to the PCRF,such as, a service identifier and a subscriber identity, and the PCRFcorrelates the application layer and the network layer of the servicebased on the application-layer information and identifies theunidentifiable service in step S501. If the PCRF identifies theunidentifiable service, it is determined whether it is necessary toadjust a charging mode and/or a rate group for the identified service.If it is determined that it is necessary to adjust the charging modeand/or the rate group for the identified service, a charging controlpolicy is regenerated. The regenerated charging control policy includesa new charging mode and/or a high-priority rate group allocated to theidentified service. The PCRF entity delivers the regenerated chargingcontrol policy to the gateway device.

Embodiment 2: The PCRF performs identification on the unidentifiableservice according to a received deep packet inspection DPI result, wherethe DPI result is reported to the PCRF by the gateway device after thegateway device performs, according to a DPI identification rule or a DPIidentification rule identifier delivered by the PCRF, identification onthe unidentifiable service. Specifically, the PCRF delivers the DPIidentification rule to the gateway device based on the followingmechanism: The PCRF determines that it is necessary to perform DPIaccording configuration of an operator or subscription data of asubscriber; for each gateway device, a list of locations ofcorresponding DPI modules is configured in the PCRF to successfullydownload a DPI identification rule, as shown in Table 2 below (a GGSN inthe GPRS is taken as an example), where DPI Type points out whether aDPI module is built into or built out of the gateway device (forexample, a GGSN);

TABLE 2 GGSN IP DPI Type DPI IP/Port List of rules or list ofidentifiers supported by a DPI module

the PCRF determines, by querying this list, a DPI module correspondingto the gateway device, so as to know whether the gateway device has aDPI capability, and if yes, delivers the DPI identification rule to thegateway device; after receiving the DPI identification rule delivered bythe PCRF or a DPI identification rule identifier allocated to the DPIidentification rule, the gateway device parses, according to the DPIidentification rule or the DPI identification rule matching the DPIidentification rule identifier, a service packet of the service datastream to acquire the application-layer information of the service datastream, for example, what is obtained through parsing is a URL of theservice data stream, which protocol adopted, which application theservice data stream belongs to, what type of application is (forexample, a streaming medium), and so on, obtains a DPI result, andreports the DPI result to the PCRF entity. If the PCRF identifies theunidentifiable service, it is determined whether it is necessary toadjust a charging mode and/or a rate group for the identified service.If it is determined that it is necessary to adjust the charging modeand/or the rate group for the identified service, a charging controlpolicy is regenerated. The regenerated charging control policy includesa new charging mode and/or a high-priority rate group allocated to theidentified service.

Embodiment 3: The PCRF entity delivers an identification rule identifierto a deep packet inspection DPI network element, so that the DPI networkelement matches, according to the identification rule identifier, anidentification rule or a group of identification rules preconfigured inthe DPI network element, detects the packets of the service data streamaccording to the matched identification rule, and reports a result ofthe detection to the PCRF entity. The PCRF entity determines, accordingto the result of the detection, whether it is necessary to change thecharging control policy. For example, the PCRF entity may deliver inadvance the DPI identification rule or the DPI identification ruleidentifier and a corresponding charging control policy (including a newcharging mode and rate group) to the gateway device according to thepolicy request message reported by the gateway device. It should benoted that, in this embodiment, the DPI identification rule identifieris used to identify a DPI identification rule or a group of DPIidentification rules and may correspond to one or more applications. Theidentification rule is preconfigured in the DPI module. The DPIidentification rule may be of a different granularity for identifying,for example, a certain URL, a certain type of URLs, a certain type ofapplication protocols, a specific application or a certain type ofapplications (for example, a type of peer-to-peer download). A specificdelivering method is described in Embodiment 2 of step S502. If thegateway device detects that the service data stream matches the DPIidentification rule delivered in advance or the identification rulecorresponding to the DPI identification rule identifier, and the DPIidentification rule or the DPI identification rule identifier deliveredin advance has a corresponding charging control policy, the gatewaydevice executes the charging control policy.

Embodiment 4: If that the PCRF confirms that it is necessary to changethe charging control policy is that the PCRF confirms according to otherinputs or triggering conditions, that it is necessary to change the rategroup of the service data stream, the charging control policyregenerated and delivered to the gateway device includes a regeneratedrate group, so that the gateway device triggers reporting of thecharging data to the charging system, where the charging data includesthe service usage information and a reporting reason for reporting thecharging data and the reporting reason indicates a change of the rategroup.

The gateway device performs charging processing according to thecharging control policy regenerated by or the charging control policydelivered in advance by the PCRF entity, where the regenerated chargingcontrol policy includes an adjustment in the charging mode and/or anadjustment in the rate group, which includes that: if the adjustment inthe charging mode is a change from non-charging to charging, the gatewaydevice records the service usage information or reports the serviceusage information to the online charging system; if the adjustment inthe charging mode is a change from charging to non-charging, the gatewaydevice reports service usage information and a reporting reason carriesa Final indication to the charging system; and if the regeneratedcharging control policy includes the adjustment in the rate group, thegateway device reports the charging data to the charging system, so thatthe charging system performs charging according to the charging data,where the charging data includes the service usage information, thereporting reason for reporting the charging data, and a rate groupre-determined by the gateway device. Specifically:

1) If the regenerated charging control policy includes the adjustment inthe charging mode, an original charging method is non-charging, and acharging mode after the adjustment is changed into online charging oroffline charging, the gateway device performs charging processingaccording to the rate group. If the charging mode after the adjustmentis online charging, firstly credit authorization is reserved in theonline charging system, and the service usage information is collectedbased on the authorization. If the charging mode after the adjustment isoffline charging, a charging data record is enabled to record theservice usage information. If the original charging method is onlinecharging or offline charging, the charging mode after the adjustment ischanged into non-charging, the gateway device disables a current recordand reports the service usage information to the charging system, wherethe reporting reason needs to carry the Final indication.

2) If the regenerated charging control policy includes the adjustment inthe rate group, the gateway device disables a counter of the servicedata stream (the counter corresponds to the original rate group) afterdetecting that the rate group changes, and reports the service usageinformation counted by the counter of the service data stream andcharging data of other service information to the charging system, wherethe reported charging data carries the reporting reason, and thereporting reason indicates that the reporting is because of the changeof the rate group of the service data stream.

For the charging system in this case, if the reporting reason includedin the charging data received by the charging system and reported by thegateway device is the change of the rate group, a rate is determinedaccording to the reporting reason and the original rate group incombination with other parameters, and fee deduction is performed, whichincludes:

Embodiment 1: If the original rate group is a high-priority rate group,t the rate of the service data stream is re-determined by using theoriginal group. It should be noted that, in the embodiment of thepresent invention, the so-called high-priority rate group refers to arate group preferentially used by the charging system to determine arate, and then perform pricing and fee deduction on the reported serviceusage information, and so on.

Embodiment 2: If the original rate group is a low-priority rate group,the charging system stores the usage information of the service datastream, and when receiving a high-priority rate group, re-determines therate of the service data stream, or when the charging system does notreceive a high-priority rate group, re-determines the rate of theservice data stream by using the original rate group. It should be notedthat, in the embodiment of the present invention, the low-priority rategroup not only represents a rate but also is used to express anindication, that is, indicating that the charging system preferentiallyuses another high-priority rate group and uses the low-priority rategroup only when no high-priority rate group exists.

If the reporting reason included in the charging data received by thecharging system and reported by the gateway device is a Final report,the rate is determined according to the reporting reason and the rategroup in combination with other parameters, and fee deduction isperformed, which includes that:

If the rate group is a high-priority rate group, where the high priorityhere means that the charging system preferentially uses this rate groupto determine the rate, the original rate group is used to price andperform fee deduction on the reported service usage information, and acharging session is closed.

If the rate group is a low-priority rate group, where the low priorityhere means that this rate group not only represents a rate but also isused to express an indication, the charging system preferentially usesanother high-priority rate group and uses the low-priority rate grouponly when no high-priority rate group exists, and if the charging systemdoes not receive a new rate group for the service data stream, uses thelow-priority rate group to perform rating and fee deduction, if a ratecorresponding to the low-priority rate group is 0, does not perform feededuction on the service usage information corresponding to the servicedata stream and the rate group during this service charging, and if feededuction has already been performed, enables a fee return procedure toreturn the deducted fee and closes a charging session.

It can be seen from the preceding example in FIG. 5 that, a policy andcharging rules function PCRF entity can determine, according to anidentification result of identifying a service, whether it is necessaryto charge at a network layer and to deliver a charging control policy toa gateway device after generating the charging control policy; when aservice data stream arrives at an application layer, and the PCRFconfirms that it is necessary to change a charging control policy, acharging control policy is regenerated and delivered to the gatewaydevice; furthermore, charging for a data service is implemented based onPCRF configuration and a rate group priority mechanism, this may controlcertain services to be charged only at the network layer and certainservices to be charged at the application layer, and control certainservices to be charged only at the application layer, certain servicesto be charged only at the network layer, and certain services to becharged at both the application layer and the network layer but atdifferent rates and so on. Therefore, compared with an existing PCCmechanism, avoiding a collaboration problem between application-layercharging and network-layer charging from a source avoids repetitivecharging, and this, compared with correlation performed by the chargingsystem to avoid repetition between application-layer charging andnetwork-layer charging, reduces difficulties and pressure in chargingcorrelation performed by the charging system and is more effectiveespecially with regard to online charging.

Refer to FIG. 6, which is a schematic flowchart of a method for chargingfor a data service according to another embodiment of the presentinvention. An execution subject of the method may be a gateway device.The following steps are mainly included:

S601. A gateway device acquires a charging control policy delivered by apolicy and charging rules function PCRF entity.

The following two specific cases are included:

Case 1: The gateway device acquires the charging control policy andknows, according to the charging control policy, a charging indicationand a rate group. If the charging indication clearly requires onlinecharging or offline charging to be performed on a specific service datastream, the gateway device performs charging processing according to therate group. For online charging, firstly credit authorization isreserved in an online charging system, and service usage information iscollected based on the authorization. For offline charging, a chargingdata record is enabled to record the service usage information. The rategroup here may be an accurate rate group determined after a service issuccessfully identified and may also be a low-priority rate group whenthe service cannot be identified.

Case 2: The gateway device acquires the charging control policy andknows, according to the charging control policy, a charging indication.If the charging indication is that charging is not performed at anetwork layer, the gateway device does not trigger online or offlinecharging but allocates bandwidth and QoS to a service data stream andthe service is released. Definitely, the gateway device may stillgenerate a charging data record not used for charging, where thecharging data record is used for reconciliation and other analysispurposes.

S602. If the charging control policy indicates that it is necessary tocharge at a network layer, the gateway device records usage informationof a service and reports charging data to a charging system, where thecharging data includes counted service usage information, such asduration or traffic.

That is to say, if it is necessary to charge at the network layer, thegateway device collects the service usage information for the service,and when a condition for a charging report is met, reports the collectedservice usage information. In this embodiment, the condition forreporting includes a change of the rate group, where the change resultsfrom a policy of the gateway device itself. In this case, a reportingreason is carried in a reported message indicates that an occurrence ofa reporting action results from the change of the rate group.

S603. If the PCRF entity delivers a regenerated charging control policy,the gateway device performs charging processing according to theregenerated charging control policy, where the regenerated chargingcontrol policy includes an adjustment in a charging mode and/or anadjustment in the rate group.

When a service stream arrives at an application layer, the PCRF entityregenerates the charging control policy according to service informationreported by an application-layer network element to the PCRF, or thePCRF entity regenerates the charging control policy according to adetection result of the service data stream and delivers the chargingcontrol policy to the gateway device, where the detection result isreported by a DPI module specified by the PCRF entity.

If the adjustment in the charging mode is a change from non-charging tocharging, the gateway device records the service usage information orreports the service usage information to the online charging system. Ifthe adjustment in the charging mode is a change from charging tonon-charging, the gateway device reports service usage information and areporting reason carries a Final indication to the charging system. Ifthe regenerated charging control policy includes the adjustment in therate group, the gateway device reports the charging data to the chargingsystem, so that the charging system performs charging according to thecharging data, where the charging data includes the service usageinformation, the reporting reason for reporting the charging data, and arate group re-determined by the gateway device.

The following further describes the method for charging for a dataservice that is provided by the present invention with reference to theembodiments of FIG. 5 and FIG. 6.

Refer to FIG. 7, which is a schematic flowchart of interaction ofdevices in a method for charging for a data service according to anembodiment of the present invention. The following steps are mainlyincluded:

S701. PCRF in a home domain and a charging system synchronouslyconfigure a charging rule.

The charging rule configured in the PCRF includes a service, whether tocharge on a PCEF, and a rate group. The service may be indicated byusing an identifier and may also be indicated by using an IP filteringrule identifier.

S702. A gateway device sends a policy request message to the policy andcharging rules function PCRF entity.

The policy request message may carry a service data stream filteringrule.

S703. The policy and charging rules function PCRF entity determines,according to an identification result of identifying a service, whetherit is necessary to charge at a network layer and to generate a chargingcontrol policy.

Specifically, the PCRF entity may match the identification ruleconfigured in the PCRF with the service stream filtering rule reportedby the gateway device. If the matching succeeds, the service issuccessfully identified, it is determined, according to theidentification result, whether it is necessary to charge at the networklayer, and if yes, a rate group is further determined. If it isdetermined, according to a query result, that it is necessary to chargeat the network layer, the PCRF generates the charging control policy,where the charging control policy includes a rate group corresponding tothe service. Optionally, the charging control policy generated after itis determined, according to the query result, to charge at the networklayer further includes a charging mode for charging for the service,such as, online charging or offline charging. If no charging mode isincluded, a default charging mode of the gateway device is used. If itis determined, according to the query result, that it is unnecessary tocharge at the network layer, determining, according to the query result,t the PCRF generates the charging control policy including an indicationfor not charging for the service, for example, indicating not to performonline charging and not to perform offline charging.

If the PCRF entity matches the identification rule configured in thePCRF with the service stream filtering rule reported by the gatewaydevice and they cannot be successfully matched, the PCRF entity confirmsthat the service is an unidentifiable service, and the PCRF entity isnot sure whether it is necessary to charge for the unidentifiableservice at the network layer. In this case, the PCRF entity may stillgenerate a charging control policy for the unidentifiable service, whichincludes that: The PCRF entity generates the charging control policyincluding a low-priority rate group and a general filtering rule for theunidentifiable service. Furthermore, when the PCRF entity determinesthat it is unnecessary to charge for the unidentifiable service at thenetwork layer, the PCRF entity generates a charging control policyincluding a low-priority rate group with a rate of 0 for theunidentifiable service. Specifically, according to a service that asubscriber subscribes to, the PCRF entity may determine certain presetgeneral filtering rules and determine a low-priority rate group. Thelow-priority rate group represents that the charging system needs toperform pricing and fee deduction on a service data stream by selectinganother related rate group with a higher priority and considers thelow-priority rate group (the low-priority rate group corresponds to apreset rate, and the preset rate may indicate a non-charging rate 0 oranother rate) only when no other rate group exists. The charging systemmay identify the low-priority rate group, and the PCRF generates thecharging control policy. The charging control policy includes thepreceding determined filtering rules and low-priority rate group, andoptionally, may further include the charging mode. If no charging modeis included, the default charging mode of the gateway is used.

S704. The policy and charging rules function PCRF delivers the generatedcharging control policy to the gateway device.

S705. The gateway device executes the charging control policy.

For online charging, firstly credit authorization is reserved in anonline charging system, and service usage information is collected basedon the authorization. For offline charging, a charging data record isenabled to record the service usage information.

S706. The gateway device reports charging data to the charging system.

That is to say, if it is necessary to charge at the network layer, thegateway device collects the service usage information for the service,and when a condition for a charging report is met, reports the collectedservice usage information. In this embodiment, the condition forreporting includes a change of the rate group, where the change resultsfrom a policy of the gateway device itself. In this case, a reportingreason is carried in a reported message indicates that an occurrence ofa reporting action results from the change of the rate group.

S707. The charging system processes the reported charging data.

If the reporting reason included in the charging data received by thecharging system and reported by the gateway device is the change of therate group, a rate is determined according to the reporting reason andan original rate group in combination with other parameters, and feededuction is performed, which includes that: If the original rate groupis a high-priority rate group, a rate of the service data stream isre-determined by using the original rate group; or if the original rategroup is a low-priority rate group, the charging system stores usageinformation of the service data stream, and when receiving ahigh-priority rate group, re-determines the rate of the service datastream, or if the charging system does not receive a high-priority rategroup, re-determines the rate of the service data stream by using theoriginal rate group.

S708. When the service data stream arrives at an application layer or aDPI module specified by the PCRF entity reports a detection result ofthe service data stream, and the PCRF entity confirms that it isnecessary to change the charging control policy, the PCRF entityregenerates a charging control policy.

S709. The PCRF entity delivers the regenerated charging control policyto the gateway device.

S710. The gateway device performs charging processing according to theregenerated charging control policy, which includes reporting thecharging data to the charging system (S711).

That is to say, if an adjustment in the charging mode is a change fromnon-charging to charging, the gateway device records the service usageinformation or reports the service usage information to the onlinecharging system. If the adjustment in the charging mode is a change fromcharging to non-charging, the gateway device reports service usageinformation and a reporting reason carries a Final indication to thecharging system. If the regenerated charging control policy includes theadjustment in the rate group, the gateway device reports the chargingdata to the charging system, so that the charging system performscharging according to the charging data, where the charging dataincludes the service usage information, the reporting reason forreporting the charging data, and a rate group re-determined by thegateway device.

S712. The charging system determines a rate according to the chargingdata and performs fee deduction.

Specifically, if the reporting reason included in the charging datareceived by the charging system and reported by the gateway device isthe change of the rate group, the rate is determined according to thereporting reason and the original rate group in combination with otherparameters, and the fee deduction is performed, which includes:

Embodiment 1: If the original rate group is a high-priority rate group,the rate of the service data stream re-determined by using the originalrate group. It should be noted that, in the embodiment of the presentinvention, the so-called high-priority rate group refers to a rate grouppreferentially used by the charging system to determine a rate, and thenperform pricing and fee deduction on the reported service usageinformation, and so on.

Embodiment 2: If the original rate group is a low-priority rate group,the charging system stores the usage information of the service datastream, and when receiving a high-priority rate group, re-determines therate of the service data stream, or when the charging system does notreceive a high-priority rate group, re-determines the rate of theservice data stream by using the original rate group. It should be notedthat, in the embodiment of the present invention, the low-priority rategroup not only represents a rate but also is used to express anindication, that is, indicating that the charging system preferentiallyuses another high-priority rate group and uses the low-priority rategroup only when no high-priority rate group exists.

If the reporting reason included in the charging data received by thecharging system and reported by the gateway device is a Final report,the rate is determined according to the reporting reason and the rategroup in combination with other parameters, and fee deduction isperformed, which includes that:

If the rate group is a high-priority rate group, where the high priorityhere means that the charging system preferentially uses this rate groupto determine the rate, the original rate group is used to price andperform fee deduction on the reported service usage information, and acharging session is closed.

If the rate group is a low-priority rate group, where the low priorityhere means that this rate group not only represents a rate but also isused to express an indication, the charging system preferentially usesanother high-priority rate group and uses the low-priority rate grouponly when no high-priority rate group exists, and if the charging systemdoes not receive a new rate group for the service data stream, uses thelow-priority rate group to perform rating and fee deduction, if a ratecorresponding to the low-priority rate group is 0, does not perform feededuction on the service usage information corresponding to the servicedata stream and the rate group during this service charging, and if feededuction has already been performed, enables a fee return procedure toreturn the deducted fee and closes a charging session.

The following takes content download (online charging is taken as anexample) as an example for description, so as to describe, in a moreclearly way, a procedure of interaction of devices in the method forcharging for a data service as shown in FIG. 7. Refer to FIG. 8, it isassumed that an operator signs an agreement with a certain SP and the SPwholesales partial traffic, fees are not charged for traffic of certainsubscribers of the SP. The example shown in

FIG. 8 mainly includes the following steps:

S801. When a subscriber accesses the Internet, a user equipment requestsa gateway device (including a PCEF) to establish a data bearer channelfor data transmission.

S802. The gateway device reports information related to a service streamto a PCRF and requests a control policy, where the policy includes: QoS,gating, charging control policies, and so on.

S803. According to information related to a service stream that isprovided by gateway device and in combination with the configuredinformation configured in the PCRF, subscription information from theoutside, subscriber information or the account information of thesubscriber, the PCRF makes a policy decision and determines an ordinaryInternet access rate group 1001 for the subscriber to access theInternet.

S804. The PCRF delivers a policy to the gateway device, where the policycarries the rate group 1001.

S805. The gateway device requests, based on the rate group 1001delivered by the PCRF, credit authorization from an online chargingsystem.

S806. The online charging system determines a rate according to asubscriber type, a package type, a reward policy, rate groupinformation, and so on, performs the credit authorization according tothe rate and the account information of the subscriber, and returnscorresponding credit authorization to the gateway device.

S807. The subscriber uses a service, and the gateway device detects ausage condition of the credit authorization, and after the subscriberpasses authentication of a specific service provider (Service Provider,SP), the SP gives a feedback to the operator that traffic of thesubscriber is counted into the wholesale traffic and a fee is notcharged for the traffic of the subscriber.

S808. The PCRF entity receives application-layer information of theservice, where the application-layer information is reported by anapplication function (Application Function, AF);

S809. Based on the application-layer information and/or a detectionresult, the PCRF entity remakes a policy decision, determines that atraffic fee is not charged for content download when the subscriberaccesses the SP, and determines a higher-priority rate group 1003indicating a rate of 0.

S810. The PCRF delivers a non-charging indication and the new rate group1003 to the gateway device.

S811. After receiving the indication, the gateway device reports serviceusage information (the reported information carries aFinal-Unit-Indication and the rate group 1003) of the subscriber thathas already been collected to the online charging system, and closes acharging session of the service after the reporting is complete.

S812. After receiving the service usage information reported by thegateway device, the online charging system decides, according topriorities of the rate group 1001 and the rate group 1003, to performfee deduction on the reported service usage information by taking therate group 1003 as a basis, and the online charging system does notcharge for the reported service usage information because the rate group1003 indicates the rate of 0, and if a fee has already been deducted, areturn is performed.

Refer to FIG. 9, which is a schematic diagram of a logical structure ofa gateway device according to an embodiment of the present invention.For ease of description, only parts related to the embodiment of thepresent invention are presented. Functional modules/units included in agateway device that are shown in FIG. 9 may be software modules/units,hardware modules/units, or software-hardware combined modules/units, andinclude a rate group change determining module 901 and a charging datareporting module 902, where:

the rate group change determining module 901 is configured to determinewhether a rate group of a service data stream changes, where the rategroup has a priority attribute, that is, rate groups may have adifferent priority, so that the charging system is capable ofdetermining an appropriate rate group for service usage informationaccording to the priority of the rate group and performing chargingaccording to the determined rate group; and the charging data reportingmodule 902 is configured to report charging data to the charging systemif the rate group change determining module 901 determines that the rategroup of the service data stream changes, so that the charging systemperforms charging according to the charging data, where in thisembodiment, the charging data includes the service usage information anda reporting reason for reporting the charging data, and the reportingreason indicates a change of the rate group.

It should be noted that, in the preceding embodiment of the gatewaydevice, the division of each functional module is only an exemplarydescription. In practical applications, the preceding functions may beallocated, according to demands, for example, a requirement ofcorresponding hardware configuration or consideration of convenience insoftware implementation, to different functional modules for completion.That is to say, an internal structure of the gateway device is dividedinto different functional modules to complete all or a part of thefunctions described above. In addition, in practical applications, acorresponding functional module in this embodiment may be implemented bycorresponding hardware, and may also be completed by correspondinghardware by executing corresponding software. For example, the precedingrate group change determining module may be hardware executing thepreceding determining of the change of the rate group of the servicedata stream. For example, a rate group change determiner may also be anordinary processor or another hardware device that can execute acorresponding computer program to complete the preceding functions. Foranother example, the preceding charging data reporting module may alsobe hardware executing the preceding function of reporting, when the rategroup change determining module (or the rate group change determiner)determines that the rate group of the service data stream changes, thecharging data to the charging system. For example, a charging datareporter may also be an ordinary processor or another hardware devicethat can execute a corresponding computer program to complete thepreceding functions. The division of each functional module/unit in thefollowing embodiments is similar and will not be described herein again.

The rate group change determining module 901 shown in FIG. 9 may furtherinclude a first parsing unit 1001 and a first determining unit 1002, asshown in a gateway device, provided by another embodiment of the presentinvention, shown in FIG. 10, where:

the first parsing unit 1001 is configured to parse a service packet ofthe service data stream according to a service identification rule; andthe first determining unit 1002 is configured to re-determine, accordingto a parsed result and rate group configuration in the gateway device, arate group, and if the re-determined rate group is different from acurrent rate group, to determine that the rate group of the service datastream changes.

The rate group change determining module 901 shown in FIG. 9 may furtherinclude a first receiving unit 1101, a second parsing unit 1102, and asecond determining unit 1103, as shown in a gateway device, provided byanother embodiment of the present invention, shown in FIG. 11, where:

the first receiving unit 1101 is configured to receive an identificationrule and a corresponding charging control policy that are delivered by apolicy and charging rules function PCRF entity, where the chargingcontrol policy includes a rate group;

the second parsing unit 1102 is configured to parse a service packet ofthe service data stream according to the identification rule deliveredby the PCRF entity; and the second determining unit 1103 is configuredto match, according to a parsed result, the rate group delivered by thePCRF entity, so as to re-determine a rate group, and if there-determined rate group is different from a current rate group, todetermine that the rate group of the service data stream changes.

The rate group change determining module 901 shown in FIG. 9 may furtherinclude a second receiving unit 1201, a third parsing unit 1202, and athird determining unit 1203, as shown in a gateway device, provided byanother embodiment of the present invention, shown in FIG. 12, where:

the second receiving unit 1201 is configured to receive anidentification rule identifier and a corresponding charging controlpolicy that are delivered by a policy and charging rules function PCRFentity, where the charging control policy includes a rate group;

the third parsing unit 1202 is configured to match, by using theidentification rule identifier delivered by the PCRF entity, anidentification rule configured in the gateway device, and parse theservice packet of the service data stream according to the matchedidentification rule; and the third determining unit 1203 is configuredto match, according to the parsed result, the rate group delivered bythe PCRF entity, so as to re-determine a rate group, and if there-determined rate group is different from a current rate group, todetermine that the rate group of the service data stream changes.

The rate group change determining module 901 shown in FIG. 9 may furtherinclude a third receiving unit 1301 and a fourth determining unit 1302,as shown in a gateway device, provided by another embodiment of thepresent invention, shown in FIG. 13, where:

the third receiving unit 1301 is configured to receive a chargingcontrol policy update command delivered by a policy and charging rulesfunction PCRF entity, where the charging control policy update commandincludes a rate group; and the fourth determining unit 1302 isconfigured to: if the rate group included in the charging control policyupdate command is different from a current rate group, determine thatthe rate group of the service data stream changes.

Refer to FIG. 14, which is a schematic diagram of a logical structure ofa charging system according to an embodiment of the present invention.For ease of description, only parts related to the embodiment of thepresent invention are presented. Functional modules/units included inthe charging system that are shown in FIG. 14 may be softwaremodules/units, hardware modules/units, or software-hardware combinedmodules/units, and include a charging data receiving module 1401, a ratedetermining module 1402, and a fee deducting module 1403, where:

the charging data receiving module 1401 is configured to receivecharging data reported by a gateway device when the gateway devicedetermines that a rate group of a service data stream changes, where thecharging data includes service usage information and a reporting reasonfor reporting the charging data, and the reporting reason indicates achange of the rate group;

the rate determining module 1402 is configured to determine a rate ofthe service data stream according to the reporting reason and anoriginal rate group; and the fee deducting module 1403 is configured toperform, according to the determined rate, fee deduction on the serviceusage information.

In this embodiment, the rate group has a priority attribute, that is,rate groups may have a different priority.

Refer to FIG. 15, which is a schematic diagram of a logical structure ofa policy and charging rules function entity according to an embodimentof the present invention. For ease of description, only parts related tothe embodiment of the present invention are presented. Functionalmodules/units included in the PCRF entity that are shown in FIG. 15 maybe software modules/units, hardware modules/units, or software-hardwarecombined modules/units, and include a determining module 1501 and acharging control policy generating module 1502, where:

the determining module 1501 is configured to determine, according to anidentification result of identifying a service, whether it is necessaryto charge at a network layer and to deliver a charging control policy toa gateway device after generating the charging control policy, so thatthe gateway device executes the charging control policy; and thecharging control policy generating module 1502 is configured toregenerate, if it is confirmed that it is necessary to change thecharging control policy, a charging control policy and to deliver thecharging control policy to the gateway device.

In another embodiment of the present invention, the charging controlpolicy generating module 1502 is specifically configured to do asfollows: if that it is confirmed that it is necessary to change thecharging control policy is that it is confirmed that it is necessary tochange a rate group of a service data stream, the charging controlpolicy regenerated and delivered to the gateway device includes aregenerated rate group, so that the gateway device triggers reporting ofcharging data to the charging system. The charging data includes serviceusage information and a reporting reason for reporting the chargingdata, and the reporting reason indicates a change of the rate group. Inthis embodiment, the rate group has a priority.

The determining module 1501 shown in FIG. 15 may further include amatching unit 1601 and a generating unit 1602, as shown in a policy andcharging rules function entity, provided by another embodiment of thepresent invention, shown in FIG. 16, where:

the matching unit 1601 is configured to match a configuredidentification rule of the PCRF entity itself with service streaminformation reported by the gateway device; and the generating unit 1602is configured to: if the matching unit 1601 fails to perform thematching successfully, confirm that a service is an unidentifiableservice, and to generate a charging control policy including alow-priority rate group, so as to subsequently change the rate groupafter the service identification and to recharge a used data stream.

Persons of ordinary skill in the art understand that all or part of thesteps of the methods in the embodiments may be implemented by a programinstructing relevant hardware. The program may be stored in a computerreadable storage medium, and the storage medium may be a read-onlymemory (ROM, Read Only Memory), a random access memory (RAM, RandomAccess Memory), a magnetic disk, an optical disk, or the like.

The preceding describes in detail a method for processing a rate group,a method for charging for a data service, and a related device andsystem that are provided by the embodiments of the present invention.Specific cases are applied or illustrating principles and theembodiments of the present invention. The foregoing description aboutthe embodiments is merely for ease of understanding the methods and coreideas of the present invention. Meanwhile, persons of ordinary skill inthe art may make modifications to specific implementation manners andapplication scopes according to the ideas of the present invention. Inconclusion, the content of this specification should not be construed asa limitation on the present invention.

What is claimed is:
 1. A charging method for a data service, comprising:obtaining a Deep Packet Inspection, DPI, identification rule identifierand a corresponding charging control policy; detecting that a servicedata stream corresponding to the data service matches a DPIidentification rule corresponding to the DPI identification ruleidentifier; and executing the charging control policy for the servicedata stream.
 2. The method according to claim 1, wherein the obtaining aDPI identification rule identifier and a corresponding charging controlpolicy comprises: obtaining the DPI identification rule identifier andthe corresponding charging control policy that are preconfigured in agateway device; or receiving the DPI identification rule identifier andthe corresponding charging control policy that are delivered by a policydecision entity.
 3. The method according to claim 2, wherein receivingthe DPI identification rule identifier and the corresponding chargingcontrol policy comprises receiving, by a gateway device, the DPIidentification rule identifier and the corresponding charging controlpolicy from the policy decision entity; and wherein the method furthercomprises sending, by the policy decision entity, the DPI identificationrule identifier and the corresponding charging control policy to thegateway device.
 4. The method according to claim 1, further comprising:identifying the DPI identification rule according to the DPIidentification rule identifier.
 5. The method according to claim 1,wherein the DPI identification rule is for identifying application-layerinformation of the service data stream, wherein the application-layerinformation comprises at least one of a uniform resource locator, URL, atype of URLs, a type of application protocols, an application or a typeof applications.
 6. The method according to claim 1, wherein theexecuting the charging control policy for the service data streamcomprises: performing charging processing for the service data streamaccording to the charging control policy.
 7. The method according toclaim 6, wherein the charging control policy comprises a rating group,and wherein the performing charging processing for the service datastream according to the charging control policy comprises: determiningthat the rate group of the service data stream changes; and reportingcharging data to a charging system, wherein the charging data comprisesusage information of the service data stream.
 8. The method according toclaim 7, wherein the rate group has a priority attribute, and the methodfurther comprises: determining, by the charging system according to thepriority attribute, the appropriate rate group.
 9. The method accordingto claim 7, wherein the performing charging processing for the servicedata stream according to the charging control policy further comprises:enabling a new counter to record new usage information of the servicedata stream.
 10. The method according to claim 7, wherein the performingcharging processing for the service data stream according to thecharging control policy further comprises: applying, based on the rategroup, to the charging system for credit authorization; receiving creditauthorization granted by the charging system.
 11. The method accordingto claim 7, wherein the charging data comprises the rate group.
 12. Themethod according to claim 7 further comprising performing, by thecharging system, charging according to the charging data.
 13. The methodaccording to claim 6, wherein the performing charging processing for theservice data stream according to the charging control policy comprises:collecting usage information for the service data stream based onauthorized credit.
 14. The method according to claim 6, wherein theperforming charging processing for the service data stream according tothe charging control policy comprises: enabling or disabling a chargingdata record for recording usage information of the service data stream.15. A communications system, comprising: a gateway device, wherein thegateway device is configured to: obtain a Deep Packet Inspection, DPI,identification rule identifier and a corresponding charging controlpolicy; detect that a service data stream corresponding to the dataservice matches a DPI identification rule corresponding to the DPIidentification rule identifier; and execute the charging control policyfor the service data stream.
 16. The communications system according toclaim 15, wherein the gateway device is further configured to obtain theDPI identification rule identifier and the corresponding chargingcontrol policy that are preconfigured in the gateway device; or whereinthe communications system further comprises a policy decision entity,wherein the policy decision entity is configured to deliver the DPIidentification rule identifier and the corresponding charging controlpolicy to the gateway device, and the gateway device is furtherconfigured to receive the DPI identification rule identifier and thecorresponding charging control policy that are delivered by the policydecision entity.
 17. The communications system according to claim 15,wherein the communications system further comprises a charging system,the charging control policy comprises a rating group, and the gatewaydevice is further configured to: determine that the rate group of theservice data stream changes; and report charging data to the chargingsystem, wherein the charging data comprises usage information of theservice data stream; and the charging system is configured to performcharging according to the charging data.
 18. A gateway device, whereinthe gateway device is configured to: obtain a Deep Packet Inspection,DPI, identification rule identifier and a corresponding charging controlpolicy; detect that a service data stream corresponding to the dataservice matches a DPI identification rule corresponding to the DPIidentification rule identifier; and execute the charging control policyfor the service data stream.
 19. The gateway device according to claim18, wherein the gateway device is further configured to: obtain the DPIidentification rule identifier and the corresponding charging controlpolicy that are preconfigured in a gateway device; or receive the DPIidentification rule identifier and the corresponding charging controlpolicy that are delivered by a policy decision entity.
 20. The gatewaydevice according to claim 18, wherein the gateway device is furtherconfigured to: determine that the rate group of the service data streamchanges; and report charging data to the charging system, wherein thecharging data comprises usage information of the service data stream.